using System.Collections.Generic;
using FluentNHibernate.Mapping;

namespace chore.Domain
{
    public class User
    {
        public virtual long Id { get; set; }
        public virtual string Name { get; set; }

        public virtual IList<Chore> Chores { get; set; }
        public virtual IList<Assignment> Assignments { get; set; }
    }

    public class UserMap : ClassMap<User>
    {
        public UserMap()
        {
            Id(u => u.Id).GeneratedBy.Identity();
            Map(u => u.Name).Unique();

            HasMany(c => c.Chores);
            HasMany(c => c.Assignments).AsBag();
        }
    }
}